﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using EQT.Dal;

public partial class NoticeDetail : System.Web.UI.Page
{
    private DaNotice dalNotice = new DaNotice();
    private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
    private DaTfile dalTfile = new DaTfile();

    protected void Page_Load(object sender, EventArgs e)
    {
        string strRecID = Request.QueryString["RecID"].ToString();

        Notice_ID.Text = "";
        Display_Name.Text = "";
        Create_Time.Text = "";
        Title.Text = "";

        try
        {
            DataSet ds = dalNotice.GetNoticeAndSetReaded(strRecID);
            if (ds.Tables[0].Rows.Count > 0)
            {
                Notice_ID.Text = ds.Tables[0].Rows[0]["Notice_ID"].ToString();
                Display_Name.Text = ds.Tables[0].Rows[0]["Display_Name"].ToString();
                Create_Time.Text = ds.Tables[0].Rows[0]["Create_Time"].ToString();
                Title.Text = ds.Tables[0].Rows[0]["Title"].ToString();
                Publish_Type_Name.Text = ds.Tables[0].Rows[0]["publish_type_name"].ToString();

                litContent.Text = "<iframe src='NoticeFile/" + ((string.IsNullOrEmpty(ds.Tables[0].Rows[0]["Notice_ID"].ToString())) ? "_Blank.htm" : ds.Tables[0].Rows[0]["Notice_ID"].ToString() + ".htm") + "' scrolling='yes' height='380px' frameborder='no' width='100%' ></iframe>";

                RepFile.DataSource = dalTfile.QueryFileRelation(Notice_ID.Text);
                RepFile.DataBind();
            }
        }
        catch (Exception ex)
        {
            log.Error("用户查看系统消息时出现异常.", ex);
        }
    }
}
